#include<iostream>
#include<map>	
using namespace std;
const int N = 1e3 + 10;
int w[N];
int n, m;
int ans;
map<int, int>mp;
map<int, int>mp1;
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) cin >> w[i];
	bool flag = 0;
	while (m--) {
		int t, k;
		cin >> t >> k;
		while (k--) {
			int x;
			cin >> x;
			/*if (!flag) {
				if (w[x] != -1) {
					mp[x] = t;
					mp1[x] = 1
				}
			}
			else {
				if (w[x] != -1) {
					if (t - mp[x] < w[x]) {
						printf("Don't take %d at %d!\n", x, t);
					}
					else mp[x] = t;
				}
			}*/
			if (!mp1[x]) {
				mp1[x] = 1;
				mp[x] = t;
			}
			else {
				if (w[x] != -1) {
					if (t - mp[x] < w[x]) {
						printf("Don't take %d at %d!\n", x, t);
					}
					else mp[x] = t;
				}
			}
		}
		//flag = 1;
	}
	return 0;
}